import React, { Component } from 'react'
import Child from './views/Child'

export default class App extends Component {
  constructor(){
    super()
    this.state={
      num:100
    }
  }
  render() {
    return (
      <div>
        <h1>父组件</h1>
        <h1>{this.state.num}</h1>
        <button onClick={()=>this.setState({num:this.state.num+1})}>+</button>
        <hr />
        <Child pnum={this.state.num}></Child>
      </div>
    )
  }
}
